import dayjs from "dayjs";
export interface SearchProp {
  type: string;
  attr: string;
  label: string;
  placeholder?: string;
  options: Array<any>;
  format?: string; // 日期格式
  // eslint-disable-next-line @typescript-eslint/ban-types
  fun?: Function;
  slot?: string;
  showTime?: any;
}

export const dealForm = (val: any) => {
  const temp: any = {};
  const keys = Object.keys(val);
  keys.forEach((k) => {
    const v = val[k];
    if (v instanceof dayjs) {
      const dayTIme = v as dayjs.Dayjs;
      temp[k] = dayTIme.format("YYYY-MM-DD");
    } else {
      temp[k] = v;
    }
  });
  return temp;
};
